package {	
	import flash.text.TextField;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.text.TextFormat;
	
	public class ScoreText extends TextField {

		public function ScoreText(size:uint = 20) {
			addEventListener(Event.ENTER_FRAME, scoreTextLoop);
			defaultTextFormat = new TextFormat(null, size);
			selectable = false;
		}			
		
		public function scoreTextLoop(e:Event) {
			var mc = e.currentTarget;
			mc.y--;
			alpha -= 0.05;
			if (alpha <= 0) {
				mc.removeEventListener(Event.ENTER_FRAME, scoreTextLoop);
				parent.removeChild(mc);
			}
		}
	}
}